# -*- coding: utf-8 -*-
# @Time : 2023/12/17 22:35
# @Author : Lpb
# @File : demo2.py
class Page:
    def __init__(self, username, password): #类的初始化方法
        self.username = username  #实例属性
        self.password = password

    def login(self, un, ps):  #实例方法
        if un == self.username:
            if ps == self.username:
                return 'login success'
            else:
                return 'login Fail'
        else:
            return 'user not found'

Page('admin','1234').login('admin','1456')

#初始化
pg=Page('admin','1234')
print(pg.login('admin','1456'))